package com.tupu.common;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

/**
 * @author : warden
 * @date : 2023/11/22 9:24
 */
public class ValidResultIntConverter implements Converter<Integer> {
    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if (value == null) {
            return new WriteCellData<>("");
        }
        if (value == 1) {
            return new WriteCellData<>("合格");
        } else if (value == 0) {
            return new WriteCellData<>("不合格");
        } else {
            return new WriteCellData<>("");
        }
    }
}
